package com.probox.common.core.enums;

public enum OrderStatusEnum {
    //1:有效 0:用户未支付取消 -1:过期未支付无效 -2:用户已支付取消
    effect("1","有效"),
    unPayCancel("0","用户未支付取消"),
    expire("-1","过期未支付无效"),
    payCancel("-2","用户已支付取消");

    private OrderStatusEnum(String k, String v) {
        this.setKey(k);
        this.setValue(v);
    }

    public static String getNameByKey(String key) {
        String rst = "";
        for(OrderStatusEnum oe: OrderStatusEnum.values()) {
            if (oe.getKey().equals(key)) {
                rst = oe.getValue();
            }
        }
        return rst;
    }

    private String key;
    private String value;

    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}
